<template>
	<view>
		<view class="topBox">
			<view class="top">
				<view class="go-back iconfont" @click="goback">
					&#xe602;
				</view>
				<view class="middle">
					收益记录

				</view>
				<view class="share iconfont">

				</view>
			</view>
			<view class="second-box">
				<view class="product-title">
					您的收益（元）
				</view>
				

			</view>
			<view class="class-box">
				<view class="class-item">
					<view class="class-item-top">{{yifu}}元</view>
					<view class="class-item-bottom">已付</view>
				</view>
				<view class="class-item class-item-2">
					<view class="class-item-top">{{yuji}}元</view>
					<view class="class-item-bottom">预计</view>
				</view>
			
			</view>
		</view>
		<view class="row-box">
			<view class="row" v-for="(item,key) in getAttr" :key="key">
				<view class="row-left">
					{{item.data_date}}
				</view>
				<view class="row-right">{{item.amount}}元 <span style="color: rgba(187, 187, 187, 1);"> ({{item.paySts}})</span></view>
			</view>
			<!-- <view class="row">
				<view class="row-left">
					2019-02-1
				</view>
				<view class="row-right">222.2元 预计</view>
			</view> -->
			
			
		</view>
		
	</view>
</template>

<script>
	import global_wyx from '../../../../components/tool/licaishiwyx';
	
	export default {
		data() {
			return {
				token:uni.getStorageSync('token_key'),
				custid:'',
				getAttr:[],
				yuji:'',
				yifu:''
			}
		},
		onLoad(item) {
			console.info(item)
			console.info("news_Id123"+item.news_Id)
			this.custid=item.news_Id;
			this.yifu = item.allProfit;
			console.info("yifu"+this.yifu)
			this.shouyi();
		},
		methods: {
			goback() {
				uni.navigateBack()
			},
			shouyi(){
				uni.request({
					url: global_wyx.api.lcs_shouyijilu,
					method: 'POST',
					data: {
						token:this.token,
						custid:this.custid
					},
					header : {'content-type':'application/x-www-form-urlencoded'},
					success: res => {
						var resultData = res.data.data;
						var resultMessage = res.data.message;//预计金额
						this.yuji = resultMessage;
						this.getAttr = resultData;
					},
					fail: () => {},
					complete: () => {}
				});
			},
			
		}
	}
</script>

<style>
	page {
		
		background: rgba(255, 255, 255, 1);
	}
	.topBox {

		width: 100%;
		
		background: url("http://ai.ylcaifu.com/appimg/images/6.0-%E6%88%91%E7%9A%84%E6%8A%95%E8%B5%84%E4%BA%BA/6.1.2-%E6%94%B6%E7%9B%8A%E6%98%8E%E7%BB%86/android/drawable-xhdpi/beijing.png")  no-repeat;
		background-size: 100% 150px;
	}

	.top {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		padding: 33px 30upx 0 18px;
		color: rgb(255, 255, 255);
	}

	.middle {
		font-size: 18px;
	}

	.go-back {
		font-size: 17px;
	}

	.share {
		font-size: 20px;
		height: 20px;
		width: 20px;
	}

	.second-box {
		width: 100%;
		display: flex;
		flex-direction: column;
		color: rgb(255, 255, 255);
		text-align: center;
	}

	.product-title {
		
		margin: 15px 0 13px;
	}
	.class-box {
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		text-align: center;
		height: 60px;
		background: rgba(255, 255, 255, 1);
		border-radius: 5px;
		box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.05);
		margin: 38upx 20upx 0;
		align-items: center;
		z-index: 9999;
	}
	
	.class-item {
		flex: 1;
	}
	
	.class-item-2 {
		border-right: 1px solid rgba(242, 241, 240, 1);
		border-left: 1px solid rgba(242, 241, 240, 1);
	}
	
	.class-item-top {
		color: rgba(51, 51, 51, 1);
		font-size: 15px;
		line-height: 40upx;
	}
	
	.class-item-bottom {
		color: rgba(187, 187, 187, 1);
		font-size: 12px;
		line-height: 30upx;
	}
	
	.persent {
		height: 38px;
		line-height: 38px;
		font-size: 32px;
		margin-bottom: 13px;

	}

	

	.row-box{
		margin-top:10px;
		background:rgb(255,255,255);
		padding: 0 30upx;
	}
	.row{
		display:flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1px solid rgba(238,238,238,1);
		height: 65px;
		font-size: 13px;
	}
	.shouyi-top{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	.product-name{
		font-size: 16px;
	}
	.shouyijine{
		font-size: 18px;
	}
	.shouyi-bottom{
		line-height: 24px;
		color:rgba(153,153,153,1);
		font-size: 12px;
	}
	
</style>
